public class C1ListCntrl {


public Id opId;
    public id onid;
    public List<C1__c> C1New{get;set;}
    public C1__c c;
    public List<C1WrapperCls> C1List {get;set;}
    public Set<String> selC1Names {get;set;}
    public List<Id> selC1Id {get;set;}
    public List<Id> BookIdList {get;set;}
    public Boolean hasSelAcct {get;set;}
    public C1__c c1 = New C1__c();
    public C1ListCntrl(ApexPages.StandardController controller) {
    this.c= (C1__c)controller.getRecord();
          C1New = new List<C1__c>();
          C1List = new List<C1WrapperCls>();
          selC1Names = new Set<String>();
          selC1Id  = new List<Id>();
          for(C1__c a : [SELECT Id,Name FROM C1__c ]){
               C1List.add(new C1WrapperCls(a));
                    }
         }
         public PageReference insert1(){
         opId = ApexPages.currentPage().getParameters().get('Id') ;        
         PageReference pageRef = new PageReference('/'+opId);
          selC1Names.clear();
          selC1Id .clear();
          hasSelAcct = false;
          for(C1WrapperCls cWrapper : C1List){
               if(cWrapper.isSelected){
                    hasSelAcct = true;   
                    selC1Names.add(cWrapper.cC1.Name);
                    selC1Id .add(cWrapper.cC1.Id);                   
                    System.debug('Return' + selC1Id);
                    }                      
                  } 
        C1__c c = New C1__c();         
         c.C1__c =  selC1Id[0] ;       
        insert c;                  
      return null;
       }
      }